﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace SmartRfMng.appcode
{
    class GetPluInfo
    {

        public static PluInfo ShowPluInfo(string PluCode)
        {
            if (SmartVar.l_PluInfo!= null && SmartVar.l_PluInfo.Count > 0)
            {
                PluInfo pluinfofind = SmartVar.l_PluInfo.Find(
                    delegate(PluInfo pluinfo)
                    {
                        return pluinfo.PluCode == PluCode;
                    });

                if (pluinfofind == null)
                {
                    pluinfofind = SmartVar.l_PluInfo.Find(
                        delegate(PluInfo pluinfo)
                        {
                            return pluinfo.ListPluBarCode.Contains(PluCode + ";");
                        });
                }

                return pluinfofind;
            }
            else
            {
                return null;
            }
            
        }


    }
}
